package routers

import (
	"xianzhi/controllers"
	"xianzhi/controllers/admin"
	"github.com/astaxie/beego"
)

func init() {
	// 虽然beego已经支持注解路由，但注解路由会用到反射机制，降低性能，所以这里还是使用注册路由

	// 初始化第一个后台管理员
	beego.Router("/init_admin_user", &controllers.MyTestController{}, "get:InitAdminUser")

	// 测试路由
	beego.Router("/test", &controllers.MyTestController{}, "get:Index;post:Index")
	beego.Router("/test_xml", &controllers.MyTestController{}, "post:TestXml")
	beego.Router("/test_access_token", &controllers.MyTestController{}, "get:AccessToken")

	// 鲜知公众号接收微信消息路由
	beego.Router("/wechat/xianzhi.html", &controllers.WechatController{}, "get:XianZhi;post:XianZhi")
	// 微信域名授权
	beego.Router("/MP_verify_5iWSUSJCUxLJphO2.txt", &controllers.WechatController{}, "get:DomainAuth;post:DomainAuth")

	// 公共路由
	beego.Router("/common/get_region_by_parent", &controllers.CommonController{}, "post:GetRegionListByParent")
	beego.Router("/send_mobile_code.html", &controllers.CommonController{}, "get:SendMobileMsg;post:SendMobileMsg")

	// 前端路由
	beego.Router("/", &controllers.IndexController{}, "get:Index")
	beego.Router("/user.html", &controllers.UserController{}, "get:Index")
	beego.Router("/user/register.html", &controllers.UserController{}, "get:Register;post:DoRegister")
	beego.Router("/user/login.html", &controllers.UserController{}, "get:Login;post:DoLogin")
	beego.Router("/user/logout.html", &controllers.UserController{}, "get:Logout;post:Logout")
	beego.Router("/user/find_password.html", &controllers.UserController{}, "get:FindPassword;post:DoFindPassword")
	beego.Router("/school/index.html", &controllers.SchoolController{}, "get:Index;post:Index")
	beego.Router("/school/load_more.html", &controllers.SchoolController{}, "post:LoadMore")
	beego.Router("/select/excellent/:id([0-9]+).html", &controllers.SchoolController{}, "get:Excellent")
	beego.Router("/select/assist.html", &controllers.SchoolController{}, "get:Assist;post:Assist")
	beego.Router("/order/add.html", &controllers.OrderController{}, "post:Add")
	beego.Router("/select/push_time.html", &controllers.PushTimeController{}, "get:Index;post:Index")
	beego.Router("/public_space.html", &controllers.OrderSchoolController{}, "get:PublicSpace;post:PublicSpace")
	beego.Router("/public_space/load_more.html", &controllers.OrderSchoolController{}, "post:LoadMore")
	beego.Router("/order/list.html", &controllers.OrderController{}, "get:Index")
	beego.Router("/selected_history.html", &controllers.OrderSchoolController{}, "get:SelectedHistory")
	beego.Router("/do_select.html", &controllers.SchoolController{}, "post:DoSelect")
	beego.Router("/cancel_select.html", &controllers.SchoolController{}, "post:CancelSelect")

	// 后端路由
	beego.Router("/upload/single_file", &admin.UploadController{}, "post:SingleFile")
	beego.Router("/upload/tencent", &admin.UploadController{}, "post:Tencent")
	beego.Router("/upload/material", &admin.UploadController{}, "post:Material")
	beego.Router("/download/:name", &admin.DownloadController{}, "get:Index")
	beego.Router("/admin", &admin.IndexController{}, "get:Index")
	beego.Router("/admin/login", &admin.UserAdminController{}, "get:Login;post:DoLogin")
	beego.Router("/admin/logout", &admin.UserAdminController{}, "get:Logout")
	beego.Router("/admin/welcome", &admin.IndexController{}, "get:Welcome")

	// 权限分类
	beego.Router("/admin/authority_category", &admin.AuthorityCategoryController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/authority_category/add", &admin.AuthorityCategoryController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/authority_category/edit/?:id", &admin.AuthorityCategoryController{}, "get:Edit;post:DoEdit")

	// 权限
	beego.Router("/admin/authority", &admin.AuthorityController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/authority/add", &admin.AuthorityController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/authority/edit/?:id", &admin.AuthorityController{}, "get:Edit;post:DoEdit")

	// 管理员角色
	beego.Router("/admin/user_admin_role", &admin.UserAdminRoleController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/user_admin_role/add", &admin.UserAdminRoleController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/user_admin_role/edit/?:id", &admin.UserAdminRoleController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/user_admin", &admin.UserAdminController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/user_admin/add", &admin.UserAdminController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/user_admin/edit/?:id", &admin.UserAdminController{}, "get:Edit;post:DoEdit")
	beego.Router("/admin/user_admin/status_switch", &admin.UserAdminController{}, "post:StatusSwitch")

	beego.Router("/admin/province", &admin.ProvinceController{}, "get:ShowProvinceList;post:ShowProvinceList")
	beego.Router("/admin/province/add", &admin.ProvinceController{}, "get:AddProvince;post:DoAddProvince")
	beego.Router("/admin/province/edit/?:id", &admin.ProvinceController{}, "get:EditProvince;post:DoEditProvince")

	beego.Router("/admin/city", &admin.CityController{}, "get:ShowCityList;post:ShowCityList")
	beego.Router("/admin/city/add", &admin.CityController{}, "get:AddCity;post:DoAddCity")
	beego.Router("/admin/city/edit/?:id", &admin.CityController{}, "get:EditCity;post:DoEditCity")

	beego.Router("/admin/set_meal", &admin.SetMealController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/set_meal/add", &admin.SetMealController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/set_meal/edit/?:id", &admin.SetMealController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/wechat_reply", &admin.WechatReplyController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/wechat_reply/add", &admin.WechatReplyController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/wechat_reply/edit/?:id", &admin.WechatReplyController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/wechat_menu_all", &admin.WechatMenuController{}, "get:ShowAllList;post:ShowAllList")
	beego.Router("/admin/wechat_menu/add", &admin.WechatMenuController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/wechat_menu/edit/?:id", &admin.WechatMenuController{}, "get:Edit;post:DoEdit")
	beego.Router("/admin/wechat_menu/del", &admin.WechatMenuController{}, "get:Del;post:Del")
	beego.Router("/admin/wechat_menu/edit_field", &admin.WechatMenuController{}, "get:EditFiled;post:EditFiled")
	beego.Router("/admin/wechat_menu/create", &admin.WechatMenuController{}, "get:Create;post:Create")

	beego.Router("/admin/school", &admin.SchoolController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/school/add", &admin.SchoolController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/school/edit/?:id", &admin.SchoolController{}, "get:Edit;post:DoEdit")
	beego.Router("/admin/school/excel_add", &admin.SchoolController{}, "get:ExcelAdd;post:DoExcelAdd")

	beego.Router("/admin/push_time", &admin.PushTimeController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/push_time/add", &admin.PushTimeController{}, "get:Add;post:DoAdd")
	beego.Router("/admin/push_time/edit/?:id", &admin.PushTimeController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/user", &admin.UserController{}, "get:ShowList;post:ShowList")
	beego.Router("/admin/user/edit/?:id", &admin.UserController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/site_config/edit/?:id", &admin.SiteConfigController{}, "get:Edit;post:DoEdit")

	beego.Router("/admin/order", &admin.OrderController{}, "get:ShowList;post:ShowList")

	beego.Router("/admin/order_school/all/:id", &admin.OrderSchoolController{}, "get:ShowAllList;post:ShowAllList")

	beego.Router("/admin/order_push_time/all/:id", &admin.OrderPushTimeController{}, "get:ShowAllList;post:ShowAllList")
}
